@extends('homeLayouts.master')
@push('css')
    <link rel="stylesheet" type="text/css" href="{{asset('org/home/css')}}/ziy.css">
@endpush

@section('content')
    <!--轮播图上方导航栏  一栏-->
    <div id="navv" class="navv_ziy">
        <div class="focus">
            <div class="focus-a">
                <div class="fouc-font fouc_font_ziy">
                    <a href="#">全部商品分类</a>
                </div>
            </div>
            <div class="focus-b">
                <ul>
                    <li><a href="/">商城首页</a></li>
                </ul>
            </div>

            <!--左边导航-->

            <!--左边导航结束-->
        </div>
    </div>
    <!--  <script type="text/javascript">
        (function(){
            var $subblock = $(".subpage"), $head=$subblock.find('h2'), $ul = $("#proinfo"), $lis = $ul.find("li"), inter=false;
            $head.mouseover(function(e){
                e.stopPropagation();
                if(!inter){
                    $ul.show();
                }else{
                    $ul.hide();
                }
                inter=!inter;
            });

            $ul.mouseover(function(event){
                event.stopPropagation();
            });

            $(document).mouseover(function(){
                $ul.hide();
                inter=!inter;
            });
        })();
    </script> -->
    <!--列表一开了-->

    <!--!!!-->
    <div class="shangp_lieb_jvz">
        <div class="selector">
            <div class="s-title">
                <h3><b>{{$category['category_name']}}</b><em>商品筛选</em></h3>
                <div class="st-ext">共&nbsp;<span>{{count($data['goods'])}}</span>个商品</div>
            </div>
            <div class="J_selectorLine s-line J_selectorFold">
                @foreach($data['attrs'] as $k=>$v)
                    {{--<div id="{{$k>=1?'yingc':''}}">--}}
                        <div class="{{$k<1?'sl-wrap':''}}">
                            <div class="sl-key">
                                <span>{{$v['attr_name']}}：</span>
                            </div>
                            <div class="sl-value">
                                <div class="sl-v-list">
                                    <ul class="J_valueList">
                                        @foreach($v->attrSon as $vv)
                                            <li>
                                                <a href="javascript:;" rel='nofollow' onclick="selectAttrs(this)" attrid="{{$vv['id']}}" class="{{in_array($vv['id'],$attrArr)?'selected':''}}">
                                                    {{$vv['attr_name']}}
                                                </a>
                                            </li>
                                        @endforeach
                                    </ul>
                                </div>
                            </div>
                        </div>
                    {{--</div>--}}

                @endforeach

                {{--<div class="s_more">--}}
                    {{--<span class="sm-wrap" onclick="xians()" data-more="材质、风格、选购热点 等">更多选项（ 材质、风格、选购热点 等）<i></i></span>--}}
                {{--</div>--}}
            </div>
        </div>
        <script>
            function selectAttrs(obj){
                // 判断当前的属性是否被选中
                if($(obj).hasClass('selected')){
                    // 如果当前属性有次属性,则移除
                    $(obj).removeClass('selected')
                }else{
                    // 点击当前的a标签,给它加上selected属性
                    $(obj).addClass('selected').parents('li').siblings('li').find('a').removeClass('selected')
                }
                // 循环带有selected属性的元素,并定义空数组,用于接收所选择的属性id
                var attrIds='';
                $.each($('.selected'),function(k,v){
                    attrIds+=$(v).attr('attrid')+','
                })
                // 将attrIds后面的逗号去掉
                attrIds=attrIds.substr(0,attrIds.length-1)
                console.log(attrIds)
                // 跳转回列表页
                location.href='/lists/{{$category['id']}}/'+attrIds
            }
        </script>

        <script type="text/javascript">
            function xians() {
                var ddd = document.getElementById('yingc');
                if (ddd.style.display == 'block') {
                    ddd.style.display = 'none';
                }
                else {
                    ddd.style.display = 'block';
                }
            }
        </script>
        <!--测试****************************************-->

        <!--测试****************************************-->
        <!--列表-->
        <div class="shangp_lieb_yi">
            <div class="filter_yi">
                <div class="f_line">
                    <div class="f_sort">
                        <a href="#" class="curr_1"><label>综合排序</label> <i></i></a>
                        <a href="#" class="curr_2">销量<i></i></a>
                        <a href="#" class="curr_2">价格<i></i></a>
                        <a href="#" class="curr_2">评论数<i></i></a>
                        <a href="#" class="curr_2">上架时间<i></i></a>
                    </div>
                    <div class="f_pager" id="J_topPage">
           			<span class="fp_text">
               			<b>1</b><em>/</em><i>166</i>
          			</span>
                        <a class="fp_prev disabled" href="#"> &lt; </a>
                        <a class="fp_next" href="#"> &gt; </a>
                    </div>
                    <div class="lieb_anniu_kuang">
                        <a class="lieb_ann" href="shangp_lieb.html"></a>
                        <a class="lieb_ann lieb_er_abn" href="shangp_lieb_1.html"></a>
                    </div>
                </div>
                <div class="f_line_xia">
                    <!-- <ul id="list1">
                        <li id="summary-stock">
                            <div class="dt">配&nbsp;送&nbsp;至：</div>
                            <div class="dd">
                                <div id="store-selector">
                                    <div class="text"><div></div><b></b></div>
                                    <div onclick="$('#store-selector').removeClass('hover')" class="close"></div>
                                </div>
                                <div id="store-prompt"><strong></strong></div>
                            </div>
                        </li>
                    </ul> -->
                    <div class="sdgdfg">配&nbsp;送&nbsp;至：</div>
                    <div class="docs-methods">
                        <form class="form-inline">
                            <div id="distpicker">
                                <div class="form-group">
                                    <div style="position: relative;">
                                        <input id="city-picker3" class="form-control" readonly type="text"
                                               value="北京市/北京市/朝阳区" data-toggle="city-picker">
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>

                    <div class="f_feature">
                        <ul>
                            <li id="delivery_211"><a class="" href="#"><i></i>货到付款</a></li>
                            <li id="delivery_daofu"><a class="" href="#"><i></i>真划算</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="shnagp_list_v1">
                <ul>
                    @foreach($data['goods'] as $v)
                    <li>
                        <div class="lieb_neir_kuang">
                            <div class="lieb_img" style="text-align: center">
                                <a href="/content/{{$v['id']}}"><img style="height: 100%" src="{{$v['pics'][0]}}"></a>
                                <div class="p_focus"><a class="J_focus" href="#"><i></i>关注</a></div>
                            </div>
                            <div class="lieb_text">
                                <div class="p_price">
                                    <strong class="J_price"><em>¥</em><i>{{$v['price']}}</i><em
                                            class="shangp_yuanj zuo_ji">¥</em><i
                                            class="shangp_yuanj">{{$v['price']}}</i></strong>
                                </div>
                            </div>
                            <div class="shangp_biaot_"><a href="/content/{{$v['id']}}">{{$v['name']}}</a></div>
                            <div class="lieb_dianp_mingc">
                                <div class="zuo_mingc">
                                    <div class="p_icons">
                                        <i class="icon_grou_1" data-tips="本地商品"><img src="{{asset('org/home/images')}}/bend.png"></i>
                                        <i class="icon_grou_2" data-tips="商品特价出售">特价</i>
                                    </div>
                                </div>
                                <div class="you_pingj">
                                    <p>已有评价</p>
                                    <span><a href="#"><em>100+</em></a> 人</span>
                                </div>
                            </div>
                        </div>
                    </li>
                    @endforeach
                </ul>
                <div class="jiaz_zhong"><a href="#">玩命加载中</a></div>
                <div class="page clearfix">
                    <div class="p-wrap" id="J_bottomPage">
		            <span class="p-num">
						<a class="pn-prev disabled" href="undefined&amp;ms=5"><i>&lt;</i><em>上一页</em></a>
						<a href="#" class="curr_3">1</a>
		                <b class="pn-break hide"> …</b>
		                <a href="/#" class="hide ">-2</a>
		                <a href="/#" class="hide ">-1</a>
		                <a href="#" class="hide ">0</a>
		                <a href="#" class="hide curr_3">1</a>
		                <a href="#" class=" ">2</a>
		                <a href="#" class=" ">3</a>
		                <b class="pn-break "> …</b>
		                <a href="#" class="">166</a>
						<a class="pn-next" href="#">下一页<i>&gt;</i></a>
					</span>
                        <span class="p-skip">
		                <em>共<b>166</b>页&nbsp;&nbsp;到第</em>
		                <input class="input-txt" value="1">
		                <em>页</em>
		                <a class="btn btn-default" href="javascript:page_jump();">确定</a>
		            </span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--列表一结束-->
    <!--猜你喜欢-->
    <div class="cain_xih">
        <div class="mt">
            <h2 class="title">猜你喜欢</h2>
            <div class="extra">
                <a href="#" class="change"><i class="ico"></i><span class="txt">换一批</span></a>
            </div>
        </div>
        <ul class="cain_xihuan_neir">
            <li>
                <div class="item_pic"><a href="#"><img src="{{asset('org/home/images')}}/lieb_tupi1.jpg"></a></div>
                <div class="cain_xih_biaot"><a href="#">伊秋梦紫 2017夏季新款韩版小清新中长款碎花雪纺连衣裙8819(米白色 XXL棉麻连衣裙，舒适透气，MM</a></div>
                <div class="cain_xih_jiaq"><p>￥560.00</p></div>
            </li>
            <li>
                <div class="item_pic"><a href="#"><img src="{{asset('org/home/images')}}/lieb_tupi2.jpg"></a></div>
                <div class="cain_xih_biaot"><a href="#">伊秋梦紫 2017夏季新款韩版小清新中长款碎花雪纺连衣裙8819(米白色 XXL棉麻连衣裙，舒适透气，MM</a></div>
                <div class="cain_xih_jiaq"><p>￥560.00</p></div>
            </li>
            <li>
                <div class="item_pic"><a href="#"><img src="{{asset('org/home/images')}}/lieb_tupi3.jpg"></a></div>
                <div class="cain_xih_biaot"><a href="#">伊秋梦紫 2017夏季新款韩版小清新中长款碎花雪纺连衣裙8819(米白色 XXL棉麻连衣裙，舒适透气，MM</a></div>
                <div class="cain_xih_jiaq"><p>￥560.00</p></div>
            </li>
            <li>
                <div class="item_pic"><a href="#"><img src="{{asset('org/home/images')}}/lieb_tupi1.jpg"></a></div>
                <div class="cain_xih_biaot"><a href="#">伊秋梦紫 2017夏季新款韩版小清新中长款碎花雪纺连衣裙8819(米白色 XXL棉麻连衣裙，舒适透气，MM</a></div>
                <div class="cain_xih_jiaq"><p>￥560.00</p></div>
            </li>
            <li>
                <div class="item_pic"><a href="#"><img src="{{asset('org/home/images')}}/lieb_tupi3.jpg"></a></div>
                <div class="cain_xih_biaot"><a href="#">伊秋梦紫 2017夏季新款韩版小清新中长款碎花雪纺连衣裙8819(米白色 XXL棉麻连衣裙，舒适透气，MM</a></div>
                <div class="cain_xih_jiaq"><p>￥560.00</p></div>
            </li>
            <li>
                <div class="item_pic"><a href="#"><img src="{{asset('org/home/images')}}/lieb_tupi2.jpg"></a></div>
                <div class="cain_xih_biaot"><a href="#">伊秋梦紫 2017夏季新款韩版小清新中长款碎花雪纺连衣裙8819(米白色 XXL棉麻连衣裙，舒适透气，MM</a></div>
                <div class="cain_xih_jiaq"><p>￥560.00</p></div>
            </li>
        </ul>
    </div>
@endsection
